﻿using System;

namespace Bricks.Injecting
{
    
    /// <summary>
    /// 
    /// </summary>
    public interface IContainerRegistryFacade
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceType"></param>
        /// <param name="service"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register(Type serviceType, object service);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceType"></param>
        /// <param name="key"></param>
        /// <param name="service"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register(Type serviceType, string key, object service);

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <param name="service"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register<TService>(TService service);

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <param name="key"></param>
        /// <param name="service"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register<TService>(string key, TService service);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceType"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register(Type serviceType);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceType"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register(Type serviceType, string key);

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <returns></returns>
        IContainerRegistryFacade Register<TService>();

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <param name="key"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register<TService>(string key);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceType"></param>
        /// <param name="implType"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register(Type serviceType, Type implType);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceType"></param>
        /// <param name="implType"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register(Type serviceType, Type implType, string key);

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <typeparam name="TImpl"></typeparam>
        /// <returns></returns>
        IContainerRegistryFacade Register<TService, TImpl>() where TImpl : TService;

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <typeparam name="TImpl"></typeparam>
        /// <param name="key"></param>
        /// <returns></returns>
        IContainerRegistryFacade Register<TService, TImpl>(string key) where TImpl : TService;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceType"></param>
        /// <returns></returns>
        bool IsRegistered(Type serviceType);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceType"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        bool IsRegistered(Type serviceType, string key);

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <returns></returns>
        bool IsRegistered<TService>();

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <param name="key"></param>
        /// <returns></returns>
        bool IsRegistered<TService>(string key);
    }

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TContainerRegistry"></typeparam>
    public interface IContainerRegistryFacade<TContainerRegistry> : IContainerRegistryFacade, IFacade<TContainerRegistry>
    {
    }
}
